import { createRouter, createWebHashHistory, createWebHistory, RouteRecordRaw } from 'vue-router';
import component from '../views/Home.vue';
import Home from '../views/Home.vue';

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    name: 'Home',
    component: Home
  },
  {
    path: '/heap',
    name: 'Heap',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "heap" */ '../views/Heap.vue')
  },
  {
    path: '/linkedList',
    name: 'LinkedList',
    component: () => import(/* webpackChunkName: "LinkedList" */ '../views/LinkedList.vue')
  },
  {
    path: '/animation',
    name: 'Animation',
    component: () => import(/* webpackChunkName: "Animation" */ '../views/Animation.vue')
  },
  {
    path: '/aniTest',
    name: 'AniTest',
    component: () => import(/* webpackChunkName: "AniTest" */ '../views/AniTest.vue')
  },
  {
    path: '/barrage',
    name: 'Barrage',
    component: () => import(/* webpackChunkName: "Barrage" */ '../views/Barrage.vue')
  },
  {
    path: '/serialPromise',
    name: 'SerialPromise',
    component: () => import(/* webpackChunkName: "SerialPromise" */ '../views/SerialPromiseDemo/index.vue')
  },
  {
    path: '/jumpDemo',
    name: 'jumpDemo',
    component: () => import(/* webpackChunkName: "SerialPromise" */ '../views/jumpDemo/index.vue')
  }
];

const router = createRouter({
  // history: createWebHistory(process.env.BASE_URL),
  history: createWebHashHistory(),
  routes
})

export default router
